function arrChange(arr, father = []) {
  if (!item?.constructor === Array) return;
  arr.forEach((item) => {
    item?.constructor === Array
      ? arrChange(item, father)
      : father.push(item);
  });
  return father;
}

function arrChange2(arr) {
  if (!Array.isArray(arr)) return;
  return arr.reduce((pre, now) => Array.isArray(now) ?
    pre.concat(arrChange2(now))
    :
    pre.concat(now), [])
}